﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace DataTier
{

    [DataContract(IsReference = false)]
    public class Connection
    {

        Location _from, _to;
        int _weight;
         
        public Connection()
        {
           
        }

        public Connection(Location from, Location to, int weight)
        {
            _from = from;
            _to = to;
            _weight = weight;
        }

        [DataMember]
        public Location From
        {
            get { return _from; }
            set { _from = value; }
        }

        [DataMember]
        public Location To
        {
            get { return _to; }
            set { _to = value; }
        }

        [DataMember]
        public int Weight
        {
            get { return _weight; }
            set { _weight = value; }
        }

        public override string ToString()
        {
            return _from.ToString() + " - " + _to.ToString();
        }

    }

}
